package com.ethink.system.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.system.api.info.SystemOrganizationInfo;
import com.ethink.system.api.request.OrganizationAddRequest;
import com.ethink.system.api.request.OrganizationPageQueryRequest;
import com.ethink.system.api.request.OrganizationQueryRequest;
import com.ethink.system.api.request.OrganizationUpdateRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 系统组织机构表 Facade接口
 *
 * @author default
 * @date 2022-09-26
 */
@FeignClient(name = "ethink-system-service", path = "system-service/facade/v1/systemOrganization", contextId = "systemOrganizationFacade")
public interface SystemOrganizationFacade {

    @PostMapping("/demo")
    @ResponseBody
    Object demo(@RequestBody Object request);

    /**
     * 新增组织
     *
     * @param request
     */
    @PostMapping("/add")
    @ResponseBody
    void add(@RequestBody OrganizationAddRequest request);

    /**
     * 修改组织
     *
     * @param request
     */
    @PostMapping("/update")
    @ResponseBody
    void update(@RequestBody OrganizationUpdateRequest request);

    /**
     * 查询所有组织
     * @param request
     * @return
     */
    @PostMapping("/systemOrganizationGetAll")
    @ResponseBody
    List<SystemOrganizationInfo> systemOrganizationGetAll(@RequestBody OrganizationQueryRequest request);

    /**
     * 根据id查询某个组织
     * @param systemOrganizationId
     * @return
     */
    @GetMapping("/getSystemOrganizationById")
    @ResponseBody
    SystemOrganizationInfo getSystemOrganizationById(@RequestParam("systemOrganizationId") Long systemOrganizationId);

    /**
     * 删除组织
     * @param id
     */
    @GetMapping("/systemOrganizationDelete")
    @ResponseBody
    void systemOrganizationDelete(@RequestParam("id") Long id);

    /**
     * 组织分页查询
     * @param request
     * @return
     */
    @PostMapping("/pageQuerySystemOrganization")
    @ResponseBody
    Page<SystemOrganizationInfo> pageQuerySystemOrganization(@RequestBody OrganizationPageQueryRequest request);
}